package logic

import (
	"context"
	"doctor-medicine-system/model/mysql"

	"doctor-medicine-system/dockerrpc/dockerrpc"
	"doctor-medicine-system/dockerrpc/internal/svc"

	"github.com/zeromicro/go-zero/core/logx"
)

type MedicineListLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewMedicineListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *MedicineListLogic {
	return &MedicineListLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

// 药品列表
func (l *MedicineListLogic) MedicineList(in *dockerrpc.MedicineListRequest) (*dockerrpc.MedicineListResponse, error) {
	// todo: add your logic here and delete this line

	var list []*dockerrpc.MedicineList

	list = mysql.MedicineList(mysql.DB)

	return &dockerrpc.MedicineListResponse{
		List: list,
	}, nil
}
